package spec.ocl_mcg;

import graph.mcg.CGNode;
import graph.mcg.ConstraintNode;

import org.eclipse.ocl.ecore.NavigationCallExp;

import tools.Tools;

//import org.eclipse.ocl.ecore.CallExp;
//import org.eclipse.ocl.ecore.NavigationCallExp;

//import tools.Tools;

public class NavigationCallExpNode extends TreeNode{
//	private String referedproperty;
	private TreeNode qualifier;
	private TreeNode navigationSource;
//	public NavigationCallExpNode(NavigationCallExp exp){
//		this.navigationSource = exp.getNavigationSource().getName();
//		if (exp.isMarkedPre()) {
//			navigationSource = "O" + Tools.firstToUpperCase(navigationSource);
//		}else{
//			navigationSource = "N" + Tools.firstToUpperCase(navigationSource);
//		}
//		expresult = navigationSource;
//	}
//	public NavigationCallExpNode(NavigationCallExp exp) {
//		this.referedproperty = exp.getNavigationSource().getName();
//		if (exp.isMarkedPre()) {
//			referedproperty = "O" + Tools.firstToUpperCase(referedproperty);
//		}else{
//			referedproperty = "N" + Tools.firstToUpperCase(referedproperty);
//		}
//		expresult = referedproperty;
//		// TODO Auto-generated constructor stub
//	}

	
	public TreeNode getQualifier() {
		return qualifier;
	}
	public void setNavigationSource(TreeNode navigationSource) {
		this.navigationSource = navigationSource;
	}

	public TreeNode getNavigationSource() {
		return navigationSource;
	}
	@Override
	public CGNode toCG() {
		// TODO Auto-generated method stub
		ConstraintNode cfgnode = new ConstraintNode(this);
		cfgnode.setConstraint(navigationSource.getExpresult());
		cfgnode.setNextnode(null);
		return cfgnode;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}
	
}
